<template>
	<web-view :src="url" @message="message" v-if="url"></web-view>
</template>

<script>
	import {methods} from '@/utils/core.js';
	export default {
		data() {
			return {
				url:''
			}
		},
		onLoad(e) {
			if(e.url){
				this.url=decodeURIComponent(e.url);
			}
			if(e.token){
				uni.setStorageSync('token',e.token);
				this.$get('user/userinfo').then(res=>{
					uni.setStorageSync('userinfo',res);
					let redict_url=uni.getStorageSync('redict_url');
					if(redict_url){
						uni.setStorageSync('redict_url','');
						uni.reLaunch({
							url:decodeURIComponent(redict_url)
						});
					}
				});
			}
		},
		methods: {
			...methods,
			message:function(){}
		}
	}
</script>

<style>
	
</style>